﻿Imports System.Data
Imports System.Data.OleDb




Partial Class Main_Main
    Inherits System.Web.UI.MasterPage

    Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load

        Dim strConnection As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("myFirstDatabase").ConnectionString)
        Dim oleDbConn As New OleDb.OleDbConnection(ConfigurationManager.ConnectionStrings("myFirstDatabase").ConnectionString)

        Dim strSQL As String = "SELECT id FROM tblvisitorSum"
        Dim objAdapter As New OleDbDataAdapter(strSQL, oleDbConn)

        Dim objDataSet As New DataSet()
        ObjAdapter.Fill(objDataSet, "dtVisitorSum")
        Dim dtVisitorSum As DataTable = objDataSet.Tables("dtVisitorSum")

        Dim dvVisitor As New DataView(dtVisitorSum)

        lblVisits.Text = dvVisitor.Count

        Page.DataBind()

    End Sub
End Class

